Skip to content

Clean up the compilation of block expressions #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2021

Conversation

lrh2000
Copy link
Contributor

@lrh2000 lrh2000 commented Apr 25, 2021

The original implementation of compiling block expressions and function bodies is incorrect. Here is an example.

fn foo() -> i32 {
    1;
    2;
    0
}

The above Rust code will compile into the below GIMPLE code.

i32 foo ()
{
  i32 D.199;

  D.199 = 1;
  return D.199;
  D.199 = 2;
  return D.199;
  D.199 = 0;
  return D.199;
}

It is obviously incorrect.

(Original in #364)

@philberty
Copy link
Member

I have 1 small nit, when it comes to git commit messages you could have used your message here in your PR which gives context to your change. This really helps when reviewing code in git to know what this change is doing.

@philberty
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 25, 2021

Build succeeded:

@bors bors bot merged commit a24a143 into Rust-GCC:master Apr 25, 2021
@lrh2000
Copy link
Contributor Author

lrh2000 commented Apr 25, 2021

I have 1 small nit, when it comes to git commit messages you could have used your message here in your PR which gives context to your change. This really helps when reviewing code in git to know what this change is doing.

I thought it was unnecessary before, because bors will automatically do it when a PR gets merged. I'll do this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants